package com.cskaoyan.utils;

import java.util.List;

/**
 *  限制list列表为4
 *
 */
public class LimitListSizeUtil<T> {
    public static <T> List limitSize(List<T> list){
        if(list.size() >= 4){
            return list.subList(0,4);
        } else {
            return list.subList(0,list.size());
        }
    }
 }
